import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("ota_task", { schema: "charge" })
export class OtaTask {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "firmware",
    comment: "固件",
    unsigned: true,
    default: () => "'0'",
  })
  firmware: number;

  @Column("int", {
    name: "total",
    comment: "总数",
    unsigned: true,
    default: () => "'0'",
  })
  total: number;

  @Column("int", {
    name: "in_progress_count",
    comment: "进行中",
    unsigned: true,
    default: () => "'0'",
  })
  inProgressCount: number;

  @Column("int", {
    name: "success_count",
    comment: "成功数量",
    unsigned: true,
    default: () => "'0'",
  })
  successCount: number;

  @Column("int", {
    name: "fail_count",
    comment: "成功数量",
    unsigned: true,
    default: () => "'0'",
  })
  failCount: number;

  @Column("tinyint", {
    name: "status",
    comment: "充电方式",
    default: () => "'0'",
  })
  status: number;

  @Column("int", {
    name: "create_time",
    comment: "结束时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;
}
